package zhieasy.cn.service.common.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import zhieasy.cn.model.common.Permission;
import zhieasy.cn.persistence.mapper.common.PermissionMapper;
import zhieasy.cn.service.common.PermissionService;

import java.util.List;

/**
 * @author DaHang
 * @date 2020/8/13 18:33
 */
@Service
public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permission> implements PermissionService {
    /**
     * 通过wxunionId获取权限list
     * @param openId
     * @return
     */
    @Override
    public List<Permission> selectPermissionByOpenId(String openId) {

        return this.baseMapper.selectPermissionByOpenId(openId);
    }

    /**
     * 通过角色获取到权限
     * @param roleId
     * @return
     */
    @Override
    public List<Permission> findPermissionByRoleId(Long roleId) {
        return this.baseMapper.findByRoleId(roleId);
    }
}
